package com.zkthink.ceres.member.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.zkthink.base.entity.Entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import java.time.LocalDateTime;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("ceres_member_password_his")
@ApiModel(value = "MemberPasswordHis", description = "会员修改密码历史表")
@AllArgsConstructor
@Builder
public class MemberPasswordHis extends Entity<Long> {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "登录用户名")
    @TableField("account")
    @Excel(name = "账户")
    private String account;

    /**
     * 登录密码
     */
    @ApiModelProperty(value = "记录密码")
    @Length(max = 64, message = "记录密码长度不能超过64")
    @TableField(value = "password", condition = LIKE)
    @Excel(name = "记录密码")
    private String password;

    @Builder
    public MemberPasswordHis(Long id, LocalDateTime createTime, LocalDateTime updateTime, Long createUser, Long updateUser,
                             String password, String account) {
        this.id = id;
        this.createTime = createTime;
        this.updateTime = updateTime;
        this.createUser = createUser;
        this.updateUser = updateUser;
        this.password = password;
        this.account = account;
    }
}
